import { Component } from '@angular/core';
import {NavController, NavParams} from 'ionic-angular';
import {HttpServies} from '../../providers/http-servies';

@Component({
  selector: 'page-wdjl',
  templateUrl: 'wdjl.html',
  providers:[HttpServies]
})
export class WdjlPage {
    dataJson:any={};
    mobile:string;

    ionViewDidLoad() {
        // this.getInfo();
        this.jlxqInfo();


    }
    userInfo={
        'mobile':'',
 
    }


  constructor( public navCtrl: NavController, public navParams: NavParams,private http: HttpServies) {
      this.mobile = navParams.get('mobile');
  }






    jlxqInfo(){
    if (this.mobile!=null){
        var param = "mobile="+this.mobile;
        this.http.httpPost('/Home/human/jianli',param)
            .then(res => {//成功
                if (res && res.code == 1) {
                    this.dataJson = res.data;
                }
            })

    }else {
        this.http.httpPost('/Home/human/mine')
            .then(res => {//成功
                if (res && res.code == 1) {
                    this.dataJson = res.data;
                } else {
                    this.http.showErro(res.msg);
                }
            })



    }
  }
    // getInfo() {
    //     this.http.httpPost('/Home/human/mine')
    //         .then(res => {//成功
    //             if (res && res.code == 1) {
    //                 this.dataJson = res.data;
    //             } else {
    //                 this.http.showErro(res.msg);
    //             }
    //         })
    // }
}
